
#SingleInstance Force
Gui, Add, Button, x62 y250 w120 h60 gInitSubmit +, Start!
Gui, Add, DropDownList, x92 y70 w160 vtarget Choose1 +, Discus Sealakel Hero|Maelstorm Wyvern
; Generated using SmartGUI Creator for SciTE
Gui, Show, w315 h354, EdoBotSZ Initialization
return
ins::
Pause
ToolTip, Paused, -1, -1, 1
return
Esc::
ExitApp
return

loop:
Loop {
	if WinActive("Shaiya") {
ImageSearch, temp, temp, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 img/%target%.png
if (ErrorLevel = 0) {
	ToolTip, Fighting, -1, -1, 1
	ImageSearch, Attackx, Attacky, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, img/Attack.png
	doClick(Attackx, Attacky, 5, 5)
}else{
	ToolTip, Searching for %target%..., -1, -1, 1
	Send {`` Down}
	Sleep, 100
	Send {`` Up}
}
}
}
return
/*Sleep, 1500
loop {
	If WinActive("Shaiya") {
Random, rand, 0, 20
SetDefaultMouseSpeed, rand
Send {`` Down}
Sleep, 50
Send {`` Up}
ImageSearch, temp, temp, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *5 img/%target%.png
if (errorlevel = 0) {
	goto Fight
}else if (errorlevel = 1) {
	goto Search
}else{
	goto Error
}
}
}
return
*/


Fight:
ToolTip, Fighting, -1, -1, 1
doClick(1605, 720, 10, 10)
goto loop
Search:
ToolTip, Searching, -1, -1, 1
goto loop
Error:
ToolTip, There was an error loading the desired image`, please make sure you spelled the name righ0t`; names are case-sensative. %target% %GUItarget%, -1, -1, 1
goto loop

InitSubmit:
Gui, Submit
Gui, Destroy
goto loop

GuiClose:
ExitApp

shift::
doClick(1605, 720, 10, 10)
;1605, 720
doClick(x, y, xoff, yoff) {
	Random, clickx, x - xoff, x + xoff
	Random, clicky, y - yoff, y + yoff
	MouseMove, %clickx%, %clicky%
	Mouseclick, Left, , , , , D
	Sleep, 50
	Mouseclick, Left, , , , , U
}